Skip to content

stats: Don't expect vec.front() to be predictable when populated from unordered container#4573

Merged
mattklein123 merged 4 commits intoenvoyproxy:masterfrom
jmarantz:test-unordered-iter-order
Oct 1, 2018
Merged

stats: Don't expect vec.front() to be predictable when populated from unordered container#4573
mattklein123 merged 4 commits intoenvoyproxy:masterfrom
jmarantz:test-unordered-iter-order

Conversation

@jmarantz
Copy link
Contributor

@jmarantz jmarantz commented Oct 1, 2018

Description: thread_local_store iterates over unordered_maps to implement counters(), etc. Some of the tests for it had two stats, but were expecting the first vector element to be a particular value. This makes the test dependent on hashes and unordered_map implementation.
Risk Level: low
Testing: //test/common/stats:thread_local_store_test
Docs Changes: n/a
Release Notes: n/a
*Fixes #Issue: #4572

…red container.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing. 1 question.

the existing ones in TestUtility.

At first I thought I didn't need the new function at all, and then I
realized the existing helper functions didn't address
.cachedCounters(), so I decided to move that template function to
utility.h and make the existing functions be one-liner calls to that.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
…replacement call to use findByName was already added.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@mattklein123 mattklein123 merged commit 26e2a31 into envoyproxy:master Oct 1, 2018
aa-stripe pushed a commit to aa-stripe/envoy that referenced this pull request Oct 11, 2018
… unordered container (envoyproxy#4573)

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Aaltan Ahmad <aa@stripe.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants